home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: news.sprintlink.net!news1!ts02-and-07
- From: dlmiller@iquest.net (Doug & Rose Miller)
- Subject: Re: Determining the length of an int in string form
- X-Nntp-Posting-Host: ts02-and-07.iquest.net
- Message-ID: <DoE38u.GIH@iquest.net>
- Sender: news@iquest.net (News Admin)
- Organization: IQuest Network Services
- X-Newsreader: News Xpress Version 1.0 Beta #2.1
- References: <3146D058.DD7@cbm.com> <4i7uth$qph@inet-nntp-gw-1.us.oracle.com>
- Date: Sun, 17 Mar 1996 02:02:28 GMT
-
- wkaufman@wkaufman.us.oracle.com (William Kaufman) wrote:
- +In article <3146D058.DD7@cbm.com> Dave Payne <paynedc@cbm.com> writes:
- +] Consider this:
- +]
- +] I have a variable of type int, and I would like to use the sprintf()
- +] function to write this variable to a string. However, I want to
- +] dynamically allocate the space for the string, and only malloc enough
- +] space to hold the int.
-
- WHY ???
-
- Even a 32-bit int is only 9 characters at most, and that's *with* the sign. Why not just declare
- a string and be done with it? Is storage space that tight for you, that nine bytes matters?
-
-